package com.vhall.component.dao.praise;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vhall.component.entity.room.RoomLikesEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author lsl
 * @since 2021/6/3
 */
@Mapper
@Repository
public interface RoomLikeMapper extends BaseMapper<RoomLikesEntity> {
    /**
     * 查询房间点赞数
     *
     * @param accountId 用户编号
     * @param roomId    房间编号
     * @return likes count
     */
    @Select("select count(id) from room_likes where account_id=#{accountId} and room_id=#{roomId} ")
    Long countIsLike(@Param("accountId") String accountId, @Param("roomId") String roomId);
}
